﻿//-----------------------------------------------------------------------
// <copyright file="IWordProcessor.cs" company="Anurag Chatterjee">
//     Copyright (c) Anurag Chatterjee. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace WordsBase
{
    using System.Collections.Generic;

    /// <summary>
    /// Word processor interface
    /// </summary>
    public interface IWordProcessor
    {
        /// <summary>
        /// Gets the word root.
        /// </summary>
        /// <param name="word">The word.</param>
        /// <returns>The root of the word</returns>
        KeyValuePair<string, string> GetWordRoot(string word);

        /// <summary>
        /// Gets all words with root.
        /// </summary>
        /// <param name="root">The root.</param>
        /// <returns>All words with this root</returns>
        List<string> GetAllWordsWithRoot(string root);

        /// <summary>
        /// Adds the word to derived list.
        /// </summary>
        /// <param name="root">The root.</param>
        /// <param name="word">The word.</param>
        /// <returns>Whether the operation was a success</returns>
        bool AddWordToDerivedList(string root, string word);

        /// <summary>
        /// Deletes the word from derived list.
        /// </summary>
        /// <param name="root">The root.</param>
        /// <param name="word">The word.</param>
        /// <returns>Whether the operation was a success</returns>
        bool DeleteWordFromDerivedList(string root, string word);

        /// <summary>
        /// Updates the word in derived list.
        /// </summary>
        /// <param name="root">The root.</param>
        /// <param name="oldWord">The old word.</param>
        /// <param name="updatedWord">The updated word.</param>
        /// <returns>Whether the operation was a success</returns>
        bool UpdateWordInDerivedList(string root, string oldWord, string updatedWord);

        /// <summary>
        /// Gets the last error message.
        /// </summary>
        /// <returns>The last error message</returns>
        string GetLastErrorMessage();
    }
}
